dhcpv4: use an AVL to store leases
authorDavid Härdeman <david@hardeman.nu>
Sat, 11 Oct 2025 06:29:07 +0000 (08:29 +0200)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Fri, 14 Nov 2025 16:24:49 +0000 (17:24 +0100)
commitaa6870be6be4e1696243b19655216b7799a5e092
treef9787fe28e2ea0ad77b348512e5c6582436bef44
parentf2d3f907e9e0050d782f2b23c1c896fb347e13c0
dhcpv4: use an AVL to store leases

An AVL has O(log n) complexity vs O(n) for a linked list in all the
operations we care about (insertion and search).

Also, it makes the code simpler by not having to care about details like
how to sort the leases.

Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/odhcpd/pull/306
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
src/config.c
src/dhcpv4.c
src/odhcpd.h
src/statefiles.c
src/ubus.c